﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <h3>Id Token</h3>
    <div id="id_token"></div>
    <h3>Access Token</h3>
    <div id="access_token"></div>
    <script src="lib/oidc-client/oidc-client.js"></script>
    <script>
        function login() {
            const config = {
                authority: 'https://localhost:8080',
                client_id: 'js',
                redirect_uri: `${window.location.origin}/callback.html`,
                response_type: 'code',
                scope: 'openid profile api',
                loadUserInfo: false
            };
            const mgr = new Oidc.UserManager(config);

            let nonce = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
            mgr.signinRedirect({
                extraQueryParams: {
                    nonce: nonce
                }
            })
        }
        login();
    </script>
</body>
</html>